package cash.cmp.personal_financial_system.mapper;

import cash.cmp.personal_financial_system.model.Bill;
import cash.cmp.personal_financial_system.model.account.Graph;
import cash.cmp.personal_financial_system.model.account.MoneyOutIn;
import cash.cmp.personal_financial_system.model.account.Pie;
import org.apache.ibatis.annotations.Mapper;
import java.util.Date;
import java.util.List;

@Mapper
public interface BillMapper {
    List<Bill> findAllBill();

    List<Bill> findBill(Integer id);

    List<Bill> findBillByAll(Integer id, Date startTime, Date endTime, String type,String bigType, int page, int pageSize);
    int countByAll(Integer id, Date startTime, Date endTime, String type, String bigType);
    int countByApp(Integer id, Integer relatedId, Date startTime, Date endTime);

    MoneyOutIn[] sumByApp(Date startTime, Date endTime, Integer id, Integer relatedId);

    List<Bill> findBillByApp(Integer id, Integer relatedId, Date startTime, Date endTime, int page, int pageSize);

    Pie[] BillByPie(Integer id, Integer relatedId, Date startTime, Date endTime, Date endTimeAdd,int billType);

    Graph[] BillByGraph1(Integer id, Integer relatedId, Date startTime, Date endTime,Date endTimeAdd,int billType);
    Graph[] BillByGraph2(Integer id, Integer relatedId, Date startTime, Date endTime,Date endTimeAdd, int billType);
    Graph[] BillByGraph3(Integer id, Integer relatedId, Date startTime, Date endTime,Date endTimeAdd, int billType);
    List<Bill> searchByApp(Integer id, Integer relatedId,Double money, String like, int page, int pageSize);
    int countSearchByApp(Integer id, Integer relatedId, Double money,String like);

    List<Bill> findBillByPage(int page, int pageSize);

    List<Bill> findBillByPageId(int page, int pageSize, int id);

    int billCount();

    int billCountById(int id);

    Boolean updateBill(Bill bill);

    Boolean insertBill(Bill bill);

    Boolean deleteBill(String billId);

    Boolean deleteBillById(Integer id);

    Boolean saveList(List<Bill> list);

}
